
<!-- main container begain -->
<div class="wrap-color-lightblue">
<div class="container theme-showcase" role="main">
    <div class="container">
        <!--user message start-->
        <div class="row bkcolor2">
            <div class="col-md-4 user-face-area">
                <div class="face-back">
                    <img class="img-circle" id="icon" src="<?php echo config('upload.imgurl').$info['face']; ?>">
                    <input type="file" class="inputFile" title="点击修改头像" onchange="handleFiles(this,'icon')" >
                </div>
                <h2><?php echo $info['username']; ?></h2>
                <p><?php echo $info['signature']; ?></p>
                <p><a class="btn btn-primary" href="#" role="button">开通会员 »</a></p>
            </div>
            <div class="col-md-8">
                <div class="row" style="padding:30px 30px 10px 0;">
                    <a href="{:url('/index/user/change')}" class="btn btn-primary pull-right"><i class="glyphicon glyphicon-edit"></i> 修改资料</a>
                </div>
                <div class="row">
                    <div class="col-sm-6">
                        <p class="user-data">公司：<?php echo empty($info['company'])?'未填写':$info['company']; ?></p>
                        <p class="user-data">职业：<?php echo empty($info['occupation'])?'未填写':$info['occupation']; ?></p>
                        <p class="user-data">邮箱：<?php echo empty($info['email'])?'未填写':$info['email']; ?></p>
                    </div>
                    <div class="col-sm-6">
                        <p class="user-data">微博：<?php echo empty($info['weibo'])?'未填写':$info['weibo']; ?></p>
                        <p class="user-data">微信：<?php echo empty($info['wechat'])?'未填写':$info['wechat']; ?></p>
                        <p class="user-data">钱包余额：0元</p>
                        <p class="user-data">赞赏状态：已开启</p>
                    </div>
                </div>
                <div class="row" style="padding:0px 30px 10px 0;">
                    <a class="btn btn-primary pull-right" role="button" data-toggle="collapse" href="#collapseExample" aria-expanded="true" aria-controls="collapseExample"><i class="glyphicon glyphicon-chevron-down"></i> 更 多</a>
                </div>
                <div class="collapse" id="collapseExample">
                    <div class="row">
                        <div class="col-sm-6">
                            <p class="user-data">真实姓名：<?php echo empty($info['realname'])?'未填写':$info['realname']; ?></p>
                            <p class="user-data">手机：<?php echo empty($info['phone'])?'未填写':$info['phone']; ?></p>
                            <p class="user-data">注册时间：<?php echo date("Y-m-d H:i",$info['regtime']); ?></p>
                        </div>
                        <div class="col-sm-6">
                            <p class="user-data">认证星级：未填写</p>
                            <p class="user-data">性别：保密</p>
                            <p class="user-data">所在地址：<?php echo empty($info['address'])?'未填写':$info['address']; ?></p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--user message end-->
        <div class="row wrap-user" data-example-id="togglable-tabs">
            <ul id="myTabs" class="nav nav-tabs" role="tablist">
                <li role="presentation" class="active"><a href="#profile" role="tab" id="profile-tab" data-toggle="tab" aria-controls="profile">我的动态</a></li>
                <li role="presentation"><a href="#home" id="home-tab" role="tab" data-toggle="tab" aria-controls="home" aria-expanded="true">说说</a></li>
                <li role="presentation" class="dropdown">
                    <a href="#" id="myTabDrop1" class="dropdown-toggle" data-toggle="dropdown" aria-controls="myTabDrop1-contents">Dropdown <span class="caret"></span></a>
                    <ul class="dropdown-menu" aria-labelledby="myTabDrop1" id="myTabDrop1-contents">
                        <li><a href="#dropdown1" role="tab" id="dropdown1-tab" data-toggle="tab" aria-controls="dropdown1">@fat</a></li>
                        <li><a href="#dropdown2" role="tab" id="dropdown2-tab" data-toggle="tab" aria-controls="dropdown2">@mdo</a></li>
                    </ul>
                </li>
            </ul>
            <div id="myTabContent" class="tab-content">
                <div role="tabpanel" class="tab-pane fade in active" id="profile" aria-labelledby="profile-tab">
                    <div class="bs-example media-wrap" data-example-id="default-media">
                        <?php foreach($msg as $item){?>
                        <div class="media">
                            <div class="media-left">
                                <a href="javascript:;">
                                    <img class="media-object" src="<?php echo config('upload.imgurl').$info['face']; ?>" data-holder-rendered="true" style="width: 64px; height: 64px;">
                                </a>
                            </div>
                            <div class="media-body">
                                <h4 class="media-heading">
                                    <?php echo $info['username']; ?>
                                    <span class="media-pubtime"><?php echo date('Y-m-d H:i',$item['pubtime']); ?></span>
                                    <button type="button" class="btn btn-del btn-xs pull-right" title="删除"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></button>
                                </h4>
                                <?php echo $item['content']; ?>
                                <?php if(!empty($item['media'])){ ?>
                                <div>
                                    <img src="<?php echo config('upload.imgurl').$item['media']; ?>" width="200px" alt="">
                                </div>
                                <?php } ?>
                            </div>
                        </div>
                        <?php } ?>
                        <div class="media-page" style="text-align: center;">
                            {$msg|raw}
                        </div>
                    </div>
                </div>
                <div role="tabpanel" class="tab-pane fade" id="home" aria-labelledby="home-tab">
                    <div class="col-sm-offset-2 col-sm-8 wrap-user-text">
                        <form method="post" action="{:url('/index/user/publish')}" enctype="multipart/form-data">
                            <div class="form-group">
                                <textarea class="form-text" name="content" placeholder="说点什么吧..."></textarea>
                            </div>
                            <div class="form-group">
                                <img src="" id="imgShow" style="width:150px;">
                            </div>
                            <div class="form-group">
                                <div class="upload-btn">
                                    <input type="file" name="upload" onchange="uploading(this)">
                                </div>
                                <button type="submit" class="btn btn-success pull-right">发 表</button>
                            </div>
                        </form>
                    </div>
                </div>
                <div role="tabpanel" class="tab-pane fade" id="dropdown1" aria-labelledby="dropdown1-tab">
                    <p>Etsy mixtape wayfarers, ethical wes anderson tofu before they sold out mcsweeney's organic lomo retro fanny pack lo-fi farm-to-table readymade. Messenger bag gentrify pitchfork tattooed craft beer, iphone skateboard locavore carles etsy salvia banksy hoodie helvetica. DIY synth PBR banksy irony. Leggings gentrify squid 8-bit cred pitchfork. Williamsburg banh mi whatever gluten-free, carles pitchfork biodiesel fixie etsy retro mlkshk vice blog. Scenester cred you probably haven't heard of them, vinyl craft beer blog stumptown. Pitchfork sustainable tofu synth chambray yr.</p>
                </div>
                <div role="tabpanel" class="tab-pane fade" id="dropdown2" aria-labelledby="dropdown2-tab">
                    <p>Trust fund seitan letterpress, keytar raw denim keffiyeh etsy art party before they sold out master cleanse gluten-free squid scenester freegan cosby sweater. Fanny pack portland seitan DIY, art party locavore wolf cliche high life echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi before they sold out farm-to-table VHS viral locavore cosby sweater. Lomo wolf viral, mustache readymade thundercats keffiyeh craft beer marfa ethical. Wolf salvia freegan, sartorial keffiyeh echo park vegan.</p>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
<!-- main container end-->
<script src="__INDEX__/js/magnifier.js"></script>
<script>
    var imgShow=document.getElementById("imgShow");
    function uploading(obj){
        //js解析图片文件的路径
        var url=window.URL.createObjectURL(obj.files[0]);
        imgShow.src=url;
        //放大镜特效
        imgShow.setAttribute("bigsrc",imgShow.src);
    }
</script>
<script>
    //上传头像
    function handleFiles(obj,id){
        var faceimg = document.getElementById('icon');
        var files = obj.files;
        var img = new Image();
        if(window.URL){
            //File API
            img.src = window.URL.createObjectURL(files[0]); //创建一个object URL，并不是你的本地路径
            img.onload = function(e) {
                window.URL.revokeObjectURL(this.src); //图片加载后，释放object URL
            }
        }
        faceimg.src=img.src;
        //上传文件
        var fd = new FormData(),//实例化一个表单
            xhr = new XMLHttpRequest();
        fd.append('image', files[0]);//追加图片元素
        xhr.open('post', "{:url('/index/user/changeFace')}");//请求方式，请求地址
        xhr.send(fd);
    }
</script>

